public class student {
    private String name;
    private int age;

    public static String classRoom;//静态成员变量

    public student() {
    }

    public student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public student(String name, int age, String classRoom) {
        this.name = name;
        this.age = age;
        this.classRoom = classRoom;
    }

    /**
     * 获取
     * @return classRoom
     */
    public static String getClassRoom() {
        return classRoom;
    }

    /**
     * 设置
     * @param classRoom
     */
    public static void setClassRoom(String classRoom) {
        student.classRoom = classRoom;
    }


    public String getName() {
        return name;
    }


    public void setName(String name) {
        this.name = name;
    }


    public int getAge() {
        return age;
    }


    public void setAge(int age) {
        this.age = age;
    }

    public void eat(){
        System.out.println(getName()+"在吃饭");
    }
    private void sing(){
        System.out.println(getName()+"在唱歌");

        {
            System.out.println("实例代码块");
        }
    }

    public String toString() {//改变输出形式
        return "student{name = " + name + ", age = " + age + ", classRoom = " + classRoom + "}";
    }
}
